home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / rexx / motionblur.rexx < prev    next >
OS/2 REXX Batch file  |  1995-06-02  |  2KB  |  79 lines

  1. /*********************************/
  2. /* Image Engineer Macro script   */
  3. /* by Simon Edwards              */
  4. /* 3/6/95                        */
  5. /*                               */
  6. /* This creates a sort of motion */
  7. /* blur effect.                  */
  8. /*********************************/
  9.  
  10. Options results
  11. signal on error            /* Setup a place for errors to go */
  12.  
  13. if arg()==0 then exit
  14.  
  15. 'REQUEST "Direction to Motion Blur in" "Horizontal|Vertical"'
  16. reply=RESULT
  17.  
  18. if reply=1 then
  19.     do
  20.     xoffset=1
  21.     yoffset=0
  22.     end
  23. else
  24.     do
  25.     xoffset=0
  26.     yoffset=1
  27.     end
  28.  
  29. 'REQUEST "Number of pixels to blur by" "1|2|4|8|16"'
  30. reply=RESULT
  31.  
  32. select
  33.     when reply=1 then times=0
  34.     when reply=2 then times=1
  35.     when reply=3 then times=2
  36.     when reply=4 then times=3
  37.     when reply=0 then times=4
  38. end
  39.  
  40. MARK arg(1) PRIMARY
  41. MARK arg(1) SECONDARY
  42. COMPOSITE xoffset yoffset Max
  43. temp=RESULT
  44.  
  45. xoffset=xoffset*2
  46. yoffset=yoffset*2
  47.  
  48. do while times~=0
  49.     MARK temp PRIMARY
  50.     MARK temp SECONDARY
  51.     COMPOSITE xoffset yoffset Max
  52.     temp2=RESULT
  53.     CLOSE temp
  54.     temp=temp2
  55.     xoffset=xoffset*2
  56.     yoffset=yoffset*2
  57.     times=times-1
  58. end
  59.  
  60. exit
  61.  
  62. /*******************************************************************/
  63. /* This is where control goes when an error code is returned by IE */
  64. /* It puts up a message saying what happened and on which line     */
  65. /*******************************************************************/
  66. error:
  67. if RC=5 then do            /* Did the user just cancel us? */
  68.     IE_TO_FRONT
  69.     LAST_ERROR
  70.     'REQUEST "'||RESULT||'"'
  71.     exit
  72. end
  73. else do
  74.     IE_TO_FRONT
  75.     LAST_ERROR
  76.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  77.     exit
  78. end
  79.